import enum

class Resource(enum.Enum):
  SERVER_STOP = 0
  SERIAL_OPEN_ERROR = 1

class Language(enum.Enum):
  CHINESE = 0

def chinese(resource):
  match resource:
    case Resource.SERVER_STOP:
      return '服务器即将停止，等待子线程处理结束'
    case Resource.SERIAL_OPEN_ERROR:
      return '打开串口失败'
    case _:
      return ''

def resource(resource, language):
  match language:
    case Language.CHINESE:
      return chinese(resource)
    case _:
      return ''